﻿Module Variables
    Structure elementos
        Dim id As Integer
        Dim paginas As Double
        Dim BaseDatos As String
        Dim titulo As String
        Dim fecha As Date
        Dim equipo As String
    End Structure

    Public Campos(50) As elementos
    Public ContCampos As Byte

    Public strDrive As String
    Public strRuta As String
    'Declaración de la API
    Private Declare Auto Function SetProcessWorkingSetSize Lib "kernel32.dll" (ByVal procHandle As IntPtr, ByVal min As Int32, ByVal max As Int32) As Boolean
    'Funcion de liberacion de memoria
    Public Sub ClearMemory()
        Try
            Dim Mem As Process
            Mem = Process.GetCurrentProcess
            SetProcessWorkingSetSize(Mem.Handle, -1, -1)
        Catch ex As Exception
            MsgBox("Error al tratar de liberar memoria", MsgBoxStyle.Critical, "ERROR!!!")
        End Try
    End Sub
End Module
